home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / manage / snmp / cmu-snmp1.0 / snmplib / snmp_impl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-19  |  2.5 KB  |  93 lines

  1. /*
  2.  * Definitions for SNMP (RFC 1067) implementation.
  3.  *
  4.  *
  5.  */
  6. /***********************************************************
  7.     Copyright 1988, 1989 by Carnegie Mellon University
  8.  
  9.                       All Rights Reserved
  10.  
  11. Permission to use, copy, modify, and distribute this software and its 
  12. documentation for any purpose and without fee is hereby granted, 
  13. provided that the above copyright notice appear in all copies and that
  14. both that copyright notice and this permission notice appear in 
  15. supporting documentation, and that the name of CMU not be
  16. used in advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.  
  18.  
  19. CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26. ******************************************************************/
  27.  
  28.  
  29. #if (defined vax) || (defined (mips))
  30. /*
  31.  * This is a fairly bogus thing to do, but there seems to be no better way for
  32.  * compilers that don't understand void pointers.
  33.  */
  34. #define void char
  35. #endif
  36.  
  37. /*
  38.  * Error codes:
  39.  */
  40. /*
  41.  * These must not clash with SNMP error codes (all positive).
  42.  */
  43. #define PARSE_ERROR    -1
  44. #define BUILD_ERROR    -2
  45.  
  46. #define SID_MAX_LEN    64
  47. #define MAX_NAME_LEN    64  /* number of subid's in a objid */
  48.  
  49. #ifndef NULL
  50. #define NULL 0
  51. #endif
  52.  
  53. #ifndef TRUE
  54. #define TRUE    1
  55. #endif
  56. #ifndef FALSE
  57. #define FALSE    0
  58. #endif
  59.  
  60. #define READ        1
  61. #define WRITE        0
  62.  
  63. #define RONLY    0xAAAA    /* read access for everyone */
  64. #define RWRITE    0xAABA    /* add write access for community private */
  65. #define NOACCESS 0x0000    /* no access for anybody */
  66.  
  67. #define INTEGER        ASN_INTEGER
  68. #define STRING        ASN_OCTET_STR
  69. #define OBJID        ASN_OBJECT_ID
  70. #define NULLOBJ        ASN_NULL
  71.  
  72. /* defined types (from the SMI, RFC 1065) */
  73. #define IPADDRESS   (ASN_APPLICATION | 0)
  74. #define COUNTER        (ASN_APPLICATION | 1)
  75. #define GAUGE        (ASN_APPLICATION | 2)
  76. #define TIMETICKS   (ASN_APPLICATION | 3)
  77. #define OPAQUE        (ASN_APPLICATION | 4)
  78.  
  79. #ifdef notdef
  80. #define ERROR(string)    sendf("%s(%d): %s",__FILE__, __LINE__, string);
  81. #else
  82. #define ERROR(string)
  83. #endif
  84.  
  85. /* from snmp.c*/
  86. extern u_char    sid[];    /* size SID_MAX_LEN */
  87.  
  88. u_char    *snmp_parse_var_op();
  89. u_char    *snmp_build_var_op();
  90.  
  91. u_char    *snmp_auth_parse();
  92. u_char    *snmp_auth_build();
  93.